#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QEvent>
#include <QMainWindow>
#include <QMessageBox>
#include <Api/userapi.h>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_btn_login_clicked();

    void on_lineEdit_code_textChanged(const QString &arg1);

private:
    Ui::MainWindow *ui;

    void captchaImage();
    void loadCodeImg();
    void addCodeWidget();
    bool eventFilter(QObject *obj, QEvent *event);

    bool captchaEnabled;
    QString uuid;
    QString img;
    QString username;
    QString pwd;
    QString code;

    UserApi userApi;
    Utils utils;
};
#endif // MAINWINDOW_H
